//
//  VedioListTableViewCell.m
//  DMT_VR
//
//  Created by xin on 16/10/18.
//  Copyright © 2016年 Elephant-Parade. All rights reserved.
//

#import "VedioListTableViewCell.h"
#import "Masonry.h"

@implementation VedioListTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        _backgroundImageView = [UIImageView new];
        _backgroundImageView.contentMode = UIViewContentModeScaleAspectFill;
        _backgroundImageView.clipsToBounds = YES;
        [self.contentView addSubview:_backgroundImageView];
        
        UIView * markView = [UIView new];
        markView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.3];
        [self.contentView addSubview:markView];
        
        _title_ch = [UILabel new];
        _title_ch.font = [UIFont fontWithName:@"HelveticaNeue-Bold" size:16.0];
        _title_ch.textColor = [UIColor whiteColor];
        [self.contentView addSubview:_title_ch];
        
        _title_en = [UILabel new];
        _title_en.font = [UIFont fontWithName:@"HelveticaNeue-Bold" size:16.0];
        _title_en.textColor = [UIColor whiteColor];
        [self.contentView addSubview:_title_en];
        
        _title_type_time = [UILabel new];
        _title_type_time.font = [UIFont fontWithName:@"HelveticaNeue-Bold" size:14.0];
        _title_type_time.textColor = [UIColor whiteColor];
        [self.contentView addSubview:_title_type_time];
        
        
        [_backgroundImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self.contentView);
        }];
        
        [markView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self.contentView);
        }];

        
        [_title_ch mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(@16);
        }];
        
        [_title_en mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(_title_ch.mas_bottom);
            make.left.equalTo(_title_ch);
        }];
        
        [_title_type_time mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(_title_en.mas_bottom).with.offset(10);
            make.left.equalTo(_title_ch);
            make.bottom.equalTo(@(-14));
        }];
    }
    return self;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
